<?php
return array(
    '_id' => 'entityNode',
    '_form' => array(
        'method' => 'post',
        'ajax-submit' => '#main',
        'accept-charset' => 'utf-8',
        'role' => 'form',
    ),
    'base' => array(
        'widget' => 'Group',
        'label' => '基本信息',
        'description' => '',
        'error' => '',
        'access' => array(
            'path' => array(
                '/admin/.*',
                '/.*?/admin/.*',
            ),
        ),
        'attributes' => array(),
        'right' => true,
        'group' => array(
            'changed' => array(
                'widget' => 'Date',
                'access' => array(
                    'addForm' => false,
                    'editForm' => false,
                ),
                'length' => 10,
                'required' => false,
                'default' => time(),
                'description' => '',
                'error' => '',
                'right' => 'true',
                'label' => '最近更改',
                'filter' => [
                    'int', 'intval',
                ],
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
            'created' => array(
                'widget' => 'Date',
                'access' => array(
                    'addForm' => true,
                    'editForm' => true,
                ),
                'required' => false,
                'label' => '创建',
                'default' => time(),
                'description' => '',
                'error' => '',
                'filter' => [
                    'int', 'intval',
                ],
                'xunsearch' => [
                    'type' => 'numeric',
                    'index' => 'self',
                ],
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
            'contentModel' => array(
                'field' => 'string',
                'required' => false,
                'label' => '内容类型',
                'description' => '',
                'error' => '',
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
            'uid' => array(
                'field' => 'number',
                'widget' => 'Chosen',
                'access' => array(
                    'addForm' => true,
                    'editForm' => true,
                ),
                'required' => false,
                'label' => '用户',
                'description' => '',
                'error' => '',
                'attributes' => array(
                    'class' => 'form-control',
                ),
                'chosenSource' => [
                    'handle' => 'username',
                ],
            ),
            'comment' => array(
                'widget' => 'Select',
                'access' => array(
                    'addForm' => true,
                    'editForm' => true,
                ),
                'label' => '开启评论',
                'default' => 1,
                'required' => true,
                'options' => array(
                    '不开启',
                    '开启',
                ),
                'filter' => array('boolval'),
                'description' => '',
                'error' => '',
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
            'sign' => array(
                'widget' => 'Selects',
                'access' => array(
                    'addForm' => true,
                    'editForm' => true,
                ),
                'label' => '属性',
                'required' => false,
                'options' => array(
                    'top' => '置顶',
                    'hot' => '热点',
                    'essence' => '精华',
                ),
                'description' => '内容的附加属性',
                'error' => '',
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
            'state' => array(
                'field' => 'number',
                'widget' => 'Select',
                'label' => '状态',
                'access' => array(
                    'addForm' => true,
                    'editForm' => true,
                ),
                'default' => 1,
                'required' => true,
                'options' => array(
                    '草稿',
                    '正常',
                    '回收站',
                ),
                'description' => '',
                'filter' => array('intval'),
                'error' => '',
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
        ),
    ),
    'contentModel' => [
        'xunsearch' => [
            'index' => 'self',
        ],
    ],
    '_options' => array(
        'xunsearch' => strtolower(WEB_CODE) . '_node',
        'checkToken' => true,
        'validation' => true,
    ),
);
